package com.demo.component;

import com.demo.model.Student;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Controller;

/**
 * @author krystal
 * @date 2023/3/6 12:46
 */
@Component
public class StudentBeans {

    @Bean
    public Student student1(){
        Student stu=new Student();
        stu.setId(04);
        stu.setName("baekhyun");
        stu.setAge(30);
        return stu;
    }

    @Bean
    public Student student2(){
        Student stu=new Student();
        stu.setId(12);
        stu.setName("do");
        stu.setAge(29);
        return stu;
    }
}
